<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.3.1-20130512"/>
<title>3D Cell: cellmath.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">3D Cell
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.3.1-20130512 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">cellmath.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="cellmath_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#ifndef CELLMATH_H</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define CELLMATH_H</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="common_8h.html">common.h</a>&quot;</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="preprocessor">#include &lt;math.h&gt;</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;</div>
<div class="line"><a name="l00007"></a><span class="lineno"><a class="code" href="cellmath_8h.html#a1daf785e3f68d293c7caa1c756d5cb74">    7</a></span>&#160;<span class="preprocessor">#define pi 3.141592653589793238462643383279</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;</div>
<div class="line"><a name="l00014"></a><span class="lineno"><a class="code" href="class_cell_math.html">   14</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_cell_math.html" title="A Cell Math class. ">CellMath</a></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;{</div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;    <a class="code" href="class_cell_math.html#aa06b314db39bdf3c36f3a42020855e72" title="A constructor. ">CellMath</a>();</div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;</div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;</div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="class_cell_math.html#a2701b1d56419b4119a9b647706891897" title="A line intersected with a plane. ">lineIntersection</a>(<span class="keyword">const</span> <span class="keywordtype">double</span> a0, <span class="keyword">const</span> <span class="keywordtype">double</span> b0, <span class="keyword">const</span> <span class="keywordtype">double</span> a1, <span class="keyword">const</span> <span class="keywordtype">double</span> b1, <span class="keyword">const</span> <span class="keywordtype">double</span> a2, <span class="keyword">const</span> <span class="keywordtype">double</span> b2,</div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;                          <span class="keyword">const</span> <span class="keywordtype">double</span> a, <span class="keyword">const</span> <span class="keywordtype">double</span> b, <span class="keyword">const</span> <span class="keywordtype">double</span> c, <span class="keyword">const</span> <span class="keywordtype">double</span> d, <span class="keywordtype">double</span> &amp;ix, <span class="keywordtype">double</span> &amp;iy, <span class="keywordtype">double</span> &amp;iz);</div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;</div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;</div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">double</span> <a class="code" href="class_cell_math.html#a26f166868ca69c02a246a4b792256177" title="A edge intersected with a plane. ">edgeIntersection</a>(<span class="keyword">const</span> <span class="keywordtype">double</span> a0, <span class="keyword">const</span> <span class="keywordtype">double</span> b0, <span class="keyword">const</span> <span class="keywordtype">double</span> a1, <span class="keyword">const</span> <span class="keywordtype">double</span> b1, <span class="keyword">const</span> <span class="keywordtype">double</span> a2, <span class="keyword">const</span> <span class="keywordtype">double</span> b2,</div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;                                   <span class="keyword">const</span> <span class="keywordtype">double</span> a, <span class="keyword">const</span> <span class="keywordtype">double</span> b, <span class="keyword">const</span> <span class="keywordtype">double</span> c, <span class="keyword">const</span> <span class="keywordtype">double</span> d, <span class="keywordtype">double</span> &amp;ix, <span class="keywordtype">double</span> &amp;iy, <span class="keywordtype">double</span> &amp;iz);</div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;</div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;</div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="class_cell_math.html#a7adada0cb08e23044858bb7af41c6052">triangleIntersection</a>(<span class="keyword">const</span> <span class="keywordtype">double</span> a, <span class="keyword">const</span> <span class="keywordtype">double</span> b, <span class="keyword">const</span> <span class="keywordtype">double</span> c, <span class="keyword">const</span> <span class="keywordtype">double</span> d,</div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;                                     <span class="keyword">const</span> <span class="keywordtype">double</span> vx0, <span class="keyword">const</span> <span class="keywordtype">double</span> vy0, <span class="keyword">const</span> <span class="keywordtype">double</span> vz0,</div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;                                     <span class="keyword">const</span> <span class="keywordtype">double</span> vx1, <span class="keyword">const</span> <span class="keywordtype">double</span> vy1, <span class="keyword">const</span> <span class="keywordtype">double</span> vz1,</div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;                                     <span class="keyword">const</span> <span class="keywordtype">double</span> vx2, <span class="keyword">const</span> <span class="keywordtype">double</span> vy2, <span class="keyword">const</span> <span class="keywordtype">double</span> vz2,</div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;                                     <span class="keywordtype">double</span> &amp;rvx0, <span class="keywordtype">double</span> &amp;rvy0, <span class="keywordtype">double</span> &amp;rvz0,</div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;                                     <span class="keywordtype">double</span> &amp;rvx1, <span class="keywordtype">double</span> &amp;rvy1, <span class="keywordtype">double</span> &amp;rvz1);</div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;</div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;</div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">double</span> <a class="code" href="class_cell_math.html#a230f3ac0ddea2ea8b337f55f0999ed86" title="A triangle intersected with a line. ">lineIntersectionTriangle</a>(<span class="keyword">const</span> <a class="code" href="class_vector3.html" title="A Vector3 class. ">Vector3</a> pos, <span class="keyword">const</span> <a class="code" href="class_vector3.html" title="A Vector3 class. ">Vector3</a> orientation, <span class="keyword">const</span> <a class="code" href="class_vector3.html" title="A Vector3 class. ">Vector3</a> v0, <span class="keyword">const</span> <a class="code" href="class_vector3.html" title="A Vector3 class. ">Vector3</a> v1, <span class="keyword">const</span> <a class="code" href="class_vector3.html" title="A Vector3 class. ">Vector3</a> v2);</div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;</div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;</div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="class_cell_math.html#adaf4a7ae548e4e4c8ad26c49f48d194f" title="Construct the rotate matrix of the axis x. ">rotateMatX</a>(<span class="keyword">const</span> <span class="keywordtype">double</span> degree, <span class="keywordtype">double</span> mat[4][4]);</div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;</div>
<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;</div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="class_cell_math.html#a7a2f5da286c4b95a6135c12cdc83e915" title="Construct the rotate matrix of the axis y. ">rotateMatY</a>(<span class="keyword">const</span> <span class="keywordtype">double</span> degree, <span class="keywordtype">double</span> mat[4][4]);</div>
<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;</div>
<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;</div>
<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="class_cell_math.html#a3acb25b26beb1fe3e68da234f80fb3ee" title="Construct the rotate matrix of the axis z. ">rotateMatZ</a>(<span class="keyword">const</span> <span class="keywordtype">double</span> degree, <span class="keywordtype">double</span> mat[4][4]);</div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;</div>
<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;</div>
<div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="class_cell_math.html#a83c66cc8c451590dbd68697bb8680537" title="Construct the translate matrix. ">translateMat</a>(<span class="keyword">const</span> <span class="keywordtype">double</span> x, <span class="keyword">const</span> <span class="keywordtype">double</span> y, <span class="keyword">const</span> <span class="keywordtype">double</span> z, <span class="keywordtype">double</span> mat[4][4]);</div>
<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;</div>
<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;</div>
<div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="class_cell_math.html#ab128b2c5cb78be65811c5eb1927b5e66" title="Construct the scale matrix. ">scaleMat</a>(<span class="keyword">const</span> <span class="keywordtype">double</span> x, <span class="keyword">const</span> <span class="keywordtype">double</span> y, <span class="keyword">const</span> <span class="keywordtype">double</span> z, <span class="keywordtype">double</span> mat[4][4]);</div>
<div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;</div>
<div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;</div>
<div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="class_cell_math.html#a0d25706f57401a07f996e10888e70dbf" title="Compute the result of a 4*4 matrix mutiplay a 4 vector. ">matMutiplyVector</a>(<span class="keyword">const</span> <span class="keywordtype">double</span> mat[4][4], <span class="keyword">const</span> <span class="keywordtype">double</span> v[4], <span class="keywordtype">double</span> result[4]);</div>
<div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;</div>
<div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;</div>
<div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="class_cell_math.html#ac14c173eea324853c3159a5366beae0d" title="Compute the result of a 4*4 matrix mutiplay a 4*4 matrix. ">matMutiply</a>(<span class="keyword">const</span> <span class="keywordtype">double</span> mat1[4][4], <span class="keyword">const</span> <span class="keywordtype">double</span> mat2[4][4], <span class="keywordtype">double</span> result[4][4]);</div>
<div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;</div>
<div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;</div>
<div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="class_cell_math.html#a7d7667706f616d10c2a2fa58ecbb1292" title="Compute the inverse matrix. ">InverseMat</a>(<span class="keyword">const</span> <span class="keywordtype">double</span> mat[4][4], <span class="keywordtype">double</span> result[4][4]);</div>
<div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;</div>
<div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;</div>
<div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="class_cell_math.html#a8326ddc72b4f5d82329628356efa7280" title="Transpote a matrix. ">TranspoteMat</a>(<span class="keyword">const</span> <span class="keywordtype">double</span> mat[4][4], <span class="keywordtype">double</span> result[4][4]);</div>
<div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;</div>
<div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;</div>
<div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">double</span> <a class="code" href="class_cell_math.html#a624b376b398d28e7064818fc2f6e6403" title="Compute the angel between two 2D vector. ">crossAngel</a>(<span class="keyword">const</span> <span class="keywordtype">double</span> ax, <span class="keyword">const</span> <span class="keywordtype">double</span> ay, <span class="keyword">const</span> <span class="keywordtype">double</span> bx, <span class="keyword">const</span> <span class="keywordtype">double</span> by);</div>
<div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;</div>
<div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;</div>
<div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="class_cell_math.html#a178f94fd0371a55898e1ac6c087c734c" title="Determine if a point in a frustum. ">isVectorInFrustum</a>(<span class="keyword">const</span> <a class="code" href="class_vector3.html" title="A Vector3 class. ">Vector3</a> p, <span class="keyword">const</span> <a class="code" href="class_vector3.html" title="A Vector3 class. ">Vector3</a> point[], <span class="keyword">const</span> <a class="code" href="class_vector3.html" title="A Vector3 class. ">Vector3</a> view, <span class="keyword">const</span> <a class="code" href="class_vector3.html" title="A Vector3 class. ">Vector3</a> up);</div>
<div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;</div>
<div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="class_cell_math.html#a3f543533aaf47a0108862af0d9ec8c67" title="Set all the members of the matrix to be 0. ">resetMat</a>(<span class="keywordtype">double</span> mat[4][4]);</div>
<div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;};</div>
<div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;</div>
<div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;<span class="preprocessor">#endif // CELLMATH_H</span></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Tue Jul 9 2013 15:49:57 for 3D Cell by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.3.1-20130512
</small></address>
</body>
</html>
